/**
 * Created by isoft-work 5 on 1/3/2015.
 */

$(document).ready(function(){
//   render
   bindEventPopupCheckBill();
//   event
});

function bindEventPopupCheckBill() {
   ISS.EVENT.bindEvent('#buttonViewOrderStatus', 'click', function () {
      popupCheckBill();
   });

   ISS.EVENT.bindEvent('#trackOrder_orderId', 'keyup', function (e) {
      if(e.keyCode === CONSTANT.KEY_CODE.ENTER) {
         popupCheckBill();
      }
   });
}

function popupCheckBill() {
   var _name = ISS.DOM.getVal('#trackOrder_emailAddress');
   var _id = ISS.DOM.getVal('#trackOrder_orderId');
   if(_name && _id ) {
      ISS.DOM.setVal('#value_search', _name);
      $('#form_popup_check_bill').submit();
   }
   else {
      alert('Hãy nhập đầy đủ thông tin !');
   }
}